package org.loadsavant.task;

import java.lang.reflect.Field;

/**
 * This immutable class represents the metadata of a task attribute and contains a 
 * reference to the field of the task implementation. 
 * 
 * @author Matt Betzel mattbetzel@gmail.com
 */
public class TaskAttributeDefinition {
	private Field field;
	private String name;
	private String description;
	private boolean required;
	
	public TaskAttributeDefinition(Field field, String name, String description,
			boolean required) {
		this.field = field;
		this.name = name;
		this.description = description;
		this.required = required;
	}

	public Field getField() {
		return field;
	}
	
	public String getName() {
		return name;
	}

	public String getDescription() {
		return description;
	}

	public boolean isRequired() {
		return required;
	}

	@Override
	public String toString() {
		return getName();
	}
}
